from pydantic import BaseModel, Field
from typing import Optional

class BrandBo(BaseModel):
    """品牌表返回模型"""
    id: int = Field(..., alias='id', description='主键')
    name: str = Field(..., alias='name', description='品牌名称')
    first_letter: Optional[str] = Field(None, alias='firstLetter', description='首字母')
    sort: int = Field(0, alias='sort', description='排序')
    factory_status: int = Field(1, alias='factoryStatus', description='是否为厂家制造商 1-是 0-否')
    show_status: int = Field(1, alias='showStatus', description='展示状态 1-展示 0-不展示')
    product_count: int = Field(0, alias='productCount', description='产品数量')
    product_comment_count: int = Field(0, alias='productCommentCount', description='评论数量')
    logo: Optional[str] = Field(None, alias='logo', description='品牌 logo')
    big_pic: Optional[str] = Field(None, alias='bigPic', description='品牌大图')
    brand_story: Optional[str] = Field(None, alias='brandStory', description='品牌故事')

    class Config:
        orm_mode = True
        allow_population_by_field_name = True


class BrandVo(BaseModel):
    """品牌表返回模型"""
    id: int = Field(..., alias='id', description='主键')
    name: str = Field(..., alias='name', description='品牌名称')
    first_letter: Optional[str] = Field(None, alias='firstLetter', description='首字母')
    sort: int = Field(0, alias='sort', description='排序')
    factory_status: int = Field(1, alias='factoryStatus', description='是否为厂家制造商 1-是 0-否')
    show_status: int = Field(1, alias='showStatus', description='展示状态 1-展示 0-不展示')
    product_count: int = Field(0, alias='productCount', description='产品数量')
    product_comment_count: int = Field(0, alias='productCommentCount', description='评论数量')
    logo: Optional[str] = Field(None, alias='logo', description='品牌 logo')
    big_pic: Optional[str] = Field(None, alias='bigPic', description='品牌大图')
    brand_story: Optional[str] = Field(None, alias='brandStory', description='品牌故事')

    model_config = {
        "from_attributes": True,
        "strict": False,
        "populate_by_name": True,
    }
